約 2,538,732 件
https://w.atwiki.jp/sfrontier/pages/42.html
Linux 作成日 2007/11/01 H.Naito 更新日 2007/11/20 H.Naito GeneralsGeneral bash サーバー構築 Qualification Generals General bash http //gensoucapsule.jugem.jp/?eid=316 サーバー構築 Linux情報 Linux でのサーバー構築に関して広範に説明しています Qualification
https://w.atwiki.jp/hear_br0wn/pages/32.html
●for構文 for構文は、特定の範囲内に記述されているJavaScriptを決められた回数繰り返し実行することができる。 繰り返しの回数は変数でカウントされ、変数が一定の条件になるまで繰り返し実行される。 変数を仮に「i」とした場合、以下の3項目が必要 ①変数「i」の初期値 ⇒変数名 = 初期値 ②繰り返しを継続する為の条件 ⇒比較演算子を使用 ③処理を一回実行するたびに変数「i」の値をどのように変更するか? ⇒インクリメント、デクリメントを使用 【①for構文の記述】 for(変数の初期値 , 繰り返しの条件 , 変数の変更){ 処理 } ※forのカッコの中は「;」( )で区切る。 例: ①変数「i」の初期値は「1」 ②繰り返しを継続する為の条件は、変数「i」が5以下になるまで繰り返す ③処理を一回実行するたびに変数「i」の値をどのように変更するか? ⇒ 処理を一回実行するごとに「i」の値を1増加する ↓ for(i=1 ; i =5 ; i++){ 処理 } 【比較演算子】 ⇒PHPコピペ 【変数の注意点】 カウンタ変数には少数を使用しない! 例えば、以下のように変数に0.1を代入し、0.1増加するような記述をした場合、 9回のメッセージウインドウが表示すると予測されます。 しかし、実際は10回表示されます。 この原因は少数以下の計算に誤差が含まれるためです。 for(i=0.1 ; i =1 ; i=i+0.1) alert("現在の値は" + i); } コンピュータの数値計算は、仕組み上、小数点以下に微笑な誤差が生じる場合があります。 このため、9回目の処理を実行したあとも変数「i」は1をわずかに下回り、10回目の処理が実行されます。 【②二重ループ】 for文を入れ子にして記述すると二重ループの繰り返し処理が可能。 その場合、以下のように処理される。 例: for (i=1 ; i =3 ; i++){ 【処理A】 for(j=1 ; j =5 ; j++){ 【処理B】 } 【処理C】 } この場合、 【処理A】と【処理C】はi=1 ; i =3により、i=1、2、3の計3回実行される。 【処理B】はi=1 ; i =3の、i=1の時にj=1~8の計8回のループ、i=2の時にj=1~8の計8回のループ、i=3の時にj=1~8の計8回のループ、の計24回実行される。 ◆document.write() HP内に文字を表示できる、その場合文字は「 」「"」で挟む。 二重ループを使った例; table border="1" tr th /th th 1 /th th 2 /th th 3 /th th 4 /th th 5 /th th 6 /th th 7 /th th 8 /th th 9 /th /tr script language="javascript" !-- for(i=1 ; i =9 ; i++){ document.write(" tr th " + i + " /th "); for(j=1 ; j =9 ; j++){ document.write(" td " + i*j + " /td "); } document.write(" /tr "); } -- /script /table 以下のように表示&解説、 ⇒javascript_practice003.png参照
https://w.atwiki.jp/suffix/pages/1662.html
for x in range(5) 処理内容 といった形で使用する。
https://w.atwiki.jp/keisks/pages/243.html
Java逆引きレシピ current directoryの取得 http //www.geocities.co.jp/AnimeComic-Ink/2723/tips/java/4.html textファイル読み込み http //www.geocities.jp/inu_poti/java/file/BufferdReader.html try catchを書かないと動かない? arraylistの謎 http //sakuramochi702.hatenablog.com/entry/2013/07/12/141252 ArrayList独自のメソッドを使わないのであれば、 List hogeList = new ArrayList(); にしておくほうが良いらしい。謎。 ※HashMapも同じでした。 Map map = new HashMap() http //topickup.web.fc2.com/java/map_hashmap.html つまりは、インターフェースなのかどうかがポイントらしい。 Array, ArrayList, or LinkedList? http //ralitblog.wordpress.com/2014/02/10/javaのリスト速度対決/ http //karetta.jp/book-node/java/230450 MapのIteratorインタフェース, HashMap http //www.javaroad.jp/java_collection5.htm http //www.javadrive.jp/start/hashmap/ Set, HashSet http //www.javaroad.jp/java_collection3.htm 拡張for文 コレクションは直接for文で使える。 http //www.javadrive.jp/start/for/index8.html http //www.techscore.com/tech/Java/JavaSE/JavaLanguage/2/ settings etc. classpass, cp, jar? 混同しやすいので注意。 http //www.ne.jp/asahi/hishidama/home/tech/java/application.html http //www.atmarkit.co.jp/fjava/onepoint/java/jv_jcmd.html jar commands 参照 jar tf abc.jar 解凍 jar xf abc.jar
https://w.atwiki.jp/chibutsu/pages/23.html
if文 if a eq 5 then begin (処理) endif else begin (処理) endelse a=5の時と、そうでない時の処理。 a=5の時だけで良いなら if a eq 5 then begin (処理) endif とする a=5かつb=5の時なら if a eq 5 and b eq 5 then begin (処理) endif とする andの他にorなども。 if文(1行) if a eq 5 then (処理) 複雑な条件 ()を使えば下のような複雑な条件も指定できる if ((a eq1)xor(b eq 1)) and (c eq 1) 以下略 普段から()を使った方が良い? goto文 ある行にラベルを作り、そのラベルへ飛ぶ 便利だが、多用は禁物。 ifやloopが使えるならそちらで済ませた方が安全。 a=1 if a eq 1 then goto, alpha print, miss alpha ;ここがラベル この場合、printは実行されずに飛ばされる。 case文 case A of 0 print, yes 1 print, no else begin print, error end endcase Aが0の場合は yes ,1のときは No を表示する.その他の場合は error を表示する. case 1 of (a gt 10) print, yes (a lt 10) print, No else print, error endcase この例の場合,a 10のときに yes を表示し,a 10 のときは No を表示する.それ意外の場合は error を表示する。 repeat文 repeat begin 処理 endrep until(終了条件) for文でループ回数が多すぎるとか言われたときでも使える。for文などにも言えるが,ループ回数を多くすると膨大な時間がかかるので.できる限りベクトル計算させる必要がある。 for文 for a=0,9 do begin (処理) endfor a=0からa=9で繰り返し処理 for文(1行) for a=0,9 do (処理) while loop break文 for, while, repeat, caseから抜けられる。使用例は以下。 i=0 repeat begin k=i*50+10 if (k gt 1000) then break i=i+1 endrep until (i eq 100)
https://w.atwiki.jp/kashisu/pages/179.html
Warrior Health 5000 Mana 200 Damage 30 Impenetrable Guard (D) 全てのBuffを解除し、3.5秒間完全無敵になる。 Cooldown 12 second Titan Slam(T) 対象に300ダメージを与え、25秒間攻撃力を35%低下させる。 攻撃成功時に対象のEnergyを6燃焼する。 Manacost 10 Cooldown 32 second Combat Mastery 攻撃時に15%の確率で150%のダメージを与える。 Battle Cry (B) 周囲700の敵ユニット15匹のターゲットを自分に引き寄せる。 Cooldown 6 second Warrior Spirit (W) 20秒間、Health+4000,Ability+8,Damage+30を上昇させる。 Manacost 150 Cooldown 50 second Shield Bash (F) 対象の詠唱しているスペルを中断し、250ダメージを与える。 中断に成功すると+250ダメージのボーナスを得る。 Manacost 35 Cooldown 18 second War Stomp (R) 周囲のユニットに160ダメージを与え、攻撃速度と移動速度を50%低下させる。 Manacost 20 Cooldown 7 second
https://w.atwiki.jp/chugoku/pages/94.html
C言語では、処理コードの前に宣言をまとめる必要があった。 C++ではどこでも宣言できる。その中でfor文内で宣言をよく使う。 #include stdio.h int main(void){ for(int i=0;i 5;i++){ printf("%d\n",i); } //printf("%d\n",i); 実行できない!!! return 0; } int i変数はforのブロック内で有効です。forを関数と考えればわかりやすい。 mainのブロック内がスコープ(有効範囲)ではありません!!!!!!!!!。 int i変数のスコープはforのブロック内がスコープ(有効範囲)です。 よって、コメントアウトしているprintfでi変数を使うことはできません。 宣言してすぐ使うのはC++のコード。 C++やJavaなどは宣言と処理コードを分けるのではなくなるべく近くで宣言して読みやすくことを優先している。 (もっと進んでる?のがPerlやRubyなどのスクリプト言語、宣言自体がない) 今のところ、OpenCVのサンプルコードでは宣言はブロックの始めに書くCのスタイルだ。 ネット上のサンプルには宣言が処理コード中にあったり、宣言即その変数を処理しているっていうのもある。C++なら問題ないのだ。 for(){}は特殊な関数と理解するといいだろう。 int abc(int x){ x=x+1; } この場合もx変数はabc関数内で有効な変数だ。 「今日の訪問数 - 」 「昨日の訪問数 - 」 「今までの訪問数 - 」 名前 コメント
https://w.atwiki.jp/miura_takashi/pages/6.html
本人専用の覚え書きです.内容未保証. 基本操作 ディレクトリ構成 bash MacPorts シリアル制御 ADVENTURE ATLAS AUTO coin CompuCell3D Fink fles_fft Fortran install JabRef libtiff OpenInventor Qt R X11 日本語化 XCode MediaWiki? 訪れた人の数: -
https://w.atwiki.jp/usonx/pages/16.html
シェル上からディレクトリを開く シェル上から現在のディレクトリをGUIで開きたい場合 cygstart . bashrcテンプレ # base-files version 3.7-1 # To pick up the latest recommended .bashrc content, # look in /etc/defaults/etc/skel/.bashrc # Modifying /etc/skel/.bashrc directly will prevent # setup from updating it. # The copy in your home directory (~/.bashrc) is yours, please # feel free to customise it to create a shell # environment to your liking. If you feel a change # would be benificial to all, please feel free to send # a patch to the cygwin mailing list. # User dependent .bashrc file # Shell Options # ############# # See man bash for more options... # Don t wait for job termination notification # set -o notify # Don t use ^D to exit # set -o ignoreeof # Use case-insensitive filename globbing # shopt -s nocaseglob # Make bash append rather than overwrite the history on disk # shopt -s histappend # When changing directory small typos can be ignored by bash # for example, cd /vr/lgo/apaache would find /var/log/apache # shopt -s cdspell # Completion options # ################## # These completion tuning parameters change the default behavior of bash_completion # Define to access remotely checked-out files over passwordless ssh for CVS # COMP_CVS_REMOTE=1 # Define to avoid stripping description in --option=description of ./configure --help # COMP_CONFIGURE_HINTS=1 # Define to avoid flattening internal contents of tar files # COMP_TAR_INTERNAL_PATHS=1 # If this shell is interactive, turn on programmable completion enhancements. # Any completions you add in ~/.bash_completion are sourced last. # case $- in # *i*) [[ -f /etc/bash_completion ]] . /etc/bash_completion ;; # esac # History Options # ############### # Don t put duplicate lines in the history. # export HISTCONTROL="ignoredups" # Ignore some controlling instructions # export HISTIGNORE="[ ]* bg fg exit" # Whenever displaying the prompt, write the previous line to disk # export PROMPT_COMMAND="history -a" # Aliases # ####### # Some example alias instructions # If these are enabled they will be used instead of any instructions # they may mask. For example, alias rm= rm -i will mask the rm # application. To override the alias instruction use a \ before, ie # \rm will call the real rm not the alias. # Interactive operation... # alias rm= rm -i # alias cp= cp -i # alias mv= mv -i # Default to human readable figures # alias df= df -h # alias du= du -h # Misc ) # alias less= less -r # raw control characters # alias whence= type -a # where, of a sort # alias grep= grep --color # show differences in colour # Some shortcuts for different directory listings alias ls= ls -hF --color=tty # classify files in colour # alias dir= ls --color=auto --format=vertical # alias vdir= ls --color=auto --format=long # alias ll= ls -l # long list # alias la= ls -A # all but . and .. # alias l= ls -CF # alias xyzzy= D /tool/Editer/xyzzy/xyzzy.exe # Functions # ######### # Some example functions # function settitle() { echo -ne "\e]2;$@\a\e]1;$@\a"; } bash_profile # base-files version 3.7-1 # To pick up the latest recommended .bash_profile content, # look in /etc/defaults/etc/skel/.bash_profile # Modifying /etc/skel/.bash_profile directly will prevent # setup from updating it. # The copy in your home directory (~/.bash_profile) is yours, please # feel free to customise it to create a shell # environment to your liking. If you feel a change # would be benifitial to all, please feel free to send # a patch to the cygwin mailing list. # ~/.bash_profile executed by bash for login shells. # source the system wide bashrc if it exists if [ -e /etc/bash.bashrc ] ; then source /etc/bash.bashrc fi # source the users bashrc if it exists if [ -e "${HOME}/.bashrc" ] ; then source "${HOME}/.bashrc" fi # Set PATH so it includes user s private bin if it exists # if [ -d "${HOME}/bin" ] ; then # PATH=${HOME}/bin ${PATH} # fi # Set MANPATH so it includes users private man if it exists # if [ -d "${HOME}/man" ]; then # MANPATH=${HOME}/man ${MANPATH} # fi # Set INFOPATH so it includes users private info if it exists # if [ -d "${HOME}/info" ]; then # INFOPATH=${HOME}/info ${INFOPATH} # fi
https://w.atwiki.jp/slimelv1024/pages/53.html
ループ文とは 1から10000までを表示するプログラムを作ろうとすると、ものすごい数のprintfを手打ちすることになります そういった繰り返し処理を楽にする命令文をループ文、又は反復構造といいます for文 for(初期化式;継続条件式;再初期化式){ 文; } 継続条件式が真の間ループする 偽になったらループを離脱する 例 for(i=1; i 10; i++){ printf("%d\n",i); } iが1から始まり、iが10より小さい間、iを表示しiをインクリメント(iを1ずつ増加)する for文の2重ループ for (初期化式1; 継続条件式1; 再初期化式1) { 文1; for (初期化式2; 継続条件式2; 再初期化式2) { 文2; } } ひとつ目のfor文の中にfor文をもうひとつ書くことで、繰り返し処理の中にさらに繰り返し処理を書くことができる 例 for(i=0;i 5;i++){ //iが5よりも小さい間ループする for(j=0;j 5;j++){ //jが5よりも小さい間ループする printf("*"); } printf("\n"); } 実行結果 ***** ***** ***** ***** ***** while文 while (継続条件式) { 文; } 継続条件式が真の間ループを繰り返す 継条件式がはじめから偽の場合は一度も実行されない while文には初期化式と再初期化式を記述する部分がないので、必要な場合は別に記述する必要があります 例 int sum=0,data; printf("整数値を入力してください\n"); scanf("%d", data); //初期化式 while(data!=-1){ //継続式 sum=sum+date; printf("合計=%d\n",sum); printf("整数値を入力してください\n"); scanf("%d", data); //再初期化式 } for文とwhile文の違い 二つの例を見てもらえばわかると思いますが、while文にはfor文と違いループする回数を決める記述がありません 一般的にfor文は○回ループさせるときに使われ、while文は~の間ループするという風に使われることが多いです が、もちろんwhile文で○回ループさせる処理も可能ですし、for文で~の間ループを繰り返すという処理も可能です 記述上の違いがあるだけで、処理上の違いはないので、どちらを用いるかはプログラマの好みの問題になります do~while文 do{ 文; }while(継続条件式); while文は一度も実行されない場合もありますが、do~while文は最低一度は実行され、その後ループするかの判定処理を行います 継続条件式の後のセミコロン(;)はワスレがちなので注意しましょう 例 int sum=0,data; do{ printf("整数値を入力してください\n"); scanf("%d", data); sum=sum+date; printf("合計=%d\n",sum); }while(data!=-1); //継続式 while文の例と実行結果は同じになりますが、初期化式がなくなっているので綺麗に見えると思います 前判定と後ろ判定という微妙な差ですが、見やすいプログラム作りのためにうまく使い分けられるようになりましょう